﻿using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
using Yoozoo.Gameplay.Liberty.AI.Utils;

namespace Yoozoo.Gameplay.Liberty.AI.Node
{
    [Category("Ggame/Liberty")]
    public class NpcAddTargetToIgnore : AIBaseNode
    {
        public BBParameter<TargetType> targetType = TargetType.CurrentLockTarget;
        
        protected override void OnExecute()
        {
            BattleAgent battleAgent = _entity.battleAgent;
            AIEntity target = _entity.battleAgent.GetTarget(targetType.value);
            if (target)
            {
                _entity.battleAgent.ignoreTargets.Add(target);
            }
            
            EndAction(true);
        }
        
    }
}